﻿<window:RadWindow x:Name="radWindow"
                  x:Class="Rio.Framework.Pages.ChildWindows.CommentChildWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:window="http://schemas.telerik.com/2008/xaml/presentation"
                  xmlns:sys="clr-namespace:System;assembly=mscorlib"
                  xmlns:conv="clr-namespace:Rio.Framework.Pages.AppCode.Helpers.Converter"
                  MaxHeight="350"
                  DialogResult="False"
                  BorderThickness="0"
                  MaxWidth="500"
                  MinWidth="300"
                  MinHeight="250"
                  CanClose="False"
                  WindowStartupLocation="CenterScreen">
    <window:RadWindow.Resources>
        <conv:NotOperatorValueConverter x:Key="NotOperatorValueConverter" />
    </window:RadWindow.Resources>
    <window:RadWindow.Effect>
        <DropShadowEffect />
    </window:RadWindow.Effect>
    <window:RadWindow.Background>
        <LinearGradientBrush EndPoint="0.5,1"
                             StartPoint="0.5,0">
            <GradientStop Color="#FFF4ED7F"
                          Offset="0" />
            <GradientStop Color="#FFF5EF81"
                          Offset="1" />
        </LinearGradientBrush>
    </window:RadWindow.Background>

    <Grid x:Name="LayoutRoot"
          Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <TextBox Grid.Row="0"
                 Name="CommentTextArea"
                 TextWrapping="Wrap"
                 AcceptsReturn="True"
                 VerticalScrollBarVisibility="Auto"
                 HorizontalScrollBarVisibility="Auto"
                 VerticalAlignment="Stretch"
                 MaxLength="8000"
                 Background="{x:Null}"
                 BorderThickness="0"
                 FontFamily="/Rio.Framework.Pages;component/Fonts/Fonts.zip#Buxton Sketch"
                 FontSize="20"
                 Text="{Binding Comment, ElementName=radWindow, Mode=TwoWay}"
                 IsReadOnly="{Binding IsReadOnly, ElementName=radWindow}" Margin="5" />
        <StackPanel HorizontalAlignment="Right"
                    Grid.Row="1"
                    Orientation="Horizontal">
            <window:RadButton  Name="ButtonOK"
                               Width="75"
                               Height="25"
                               Command="{Binding CloseCommand, ElementName=radWindow, Mode=TwoWay}"
                               IsEnabled="{Binding IsReadOnly, Converter={StaticResource NotOperatorValueConverter}, ElementName=radWindow, Mode=TwoWay}">
                <window:RadButton.CommandParameter>
                    <sys:Boolean>
                        False
                    </sys:Boolean>
                </window:RadButton.CommandParameter>
            </window:RadButton>
            <window:RadButton  Name="ButtonCancel"
                               Height="25"
                               Width="75"
                               Margin="5,0,5,0"
                               Command="{Binding CloseCommand, ElementName=radWindow, Mode=TwoWay}">
                <window:RadButton.CommandParameter>
                    <sys:Boolean>
                        True
                    </sys:Boolean>
                </window:RadButton.CommandParameter>
            </window:RadButton>
        </StackPanel>
    </Grid>
</window:RadWindow>